<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
</head>
<body>
    <table id="tab">
        <tbody>
            <tr>
                <td>第一行</td><td>第一行</td>
            </tr>
            <tr>
                <td>第二行</td><td>第二行</td>
            </tr>
            <tr>
                <td>第三行</td><td>第三行</td>
            </tr>
            <tr>
                <td>第四行</td><td>第四行</td>
            </tr>
            <tr>
                <td>第五行</td><td>第五行</td>
            </tr>
        </tbody>
    </table>
    
        <input type="checkbox" value="1" name="check" checked="checked" />
        <input type="checkbox" value="2" name="check"  />
        <input type="checkbox" value="3" name="check" checked="checked" />
        <input type="checkbox" value="4" name="check"   />
    <script>
        
        var num=0
        var huhu= $('tr').filter(Element=>{
            num++;
            if (num%2==0) {
                return Element
            }
            
        })
        huhu.css('color','red')
        
        
        var body = document.querySelector('body')
        body.addEventListener('change',()=>{
            num=0
            var huahua= $('[type="checkbox"]')
            var gugu=huahua.map(Element=>{
                if(huahua[Element].checked){
                    num++
                }
            })
            console.log('选中'+num+'个');
        }) 
        
    </script>

</script>
</html>
